﻿@using XStudio.XCRF.Data.Entities.CureInfo;
@using XStudio.XCRF.Resources.Entities.CureInfo;
@using XStudio.XCRF.Resources.Entities;
@model Guid
@{
    ViewBag.Title = "CureInfoHisGridList";
    Layout = "~/Views/Shared/Master.cshtml";
}
@{Html.Telerik().Window().Name("CureInfoHisGridWindow").Title("治疗信息历史记录").HtmlAttributes(new { @class = "ContentLargeWindow" })
      .Buttons(buttons => buttons.Clear())
    .Content(
@<text>
    @(Html.Telerik().Grid<CureInfo>()
    .Name("CureInfoHisViewGrid")
    .DataKeys(keys => keys.Add(cure => cure.ID))
    .Columns(columns =>
    {
        columns.Bound(cure => cure.ID).Hidden();
        columns.BoundDate(cure => cure.Time).Title(CureInfoResource.Time);
        columns.BoundDateTime(cure => cure.LastModifyTime).Title(BaseEntityResource.LastModifyTime);
        columns.Bound(cure => cure.LastModifier.RealName).Title(BaseEntityResource.LastModifier);
        columns.BoundDateTime(cure => cure.CreateTime).Title(BaseEntityResource.CreateTime);
        columns.Bound(cure => cure.Creater.RealName).Title(BaseEntityResource.Creater);
        columns.Command(commands =>
        {
            commands.Custom("Detail").Text("查看详情").Ajax(true);
        }).Title("操作");
    })
    .ClientEvents(events =>
    {
        events.OnCommand("OnCureInfoHisCommand");
    })
    .DataBinding(bind =>
    {
        bind.Ajax().Select<CureInfoController>(c => c._CureInfoHisGridList((Guid)Model));
    })
    )
</text>
    ).Render();
}
<script type="text/javascript">
    function CureInfoDetail(id, time) {
        var tt = time.toString();
        var url = "@(Url.Action<CureInfoController>(c => c._CureInfoDetail(Guid.Empty, "mlgb")))";
        url = url.replace("@Guid.Empty", id);
        url = url.replace("mlgb", tt);
        url = url.replace("amp;", "");
        window.location = url;
    }
    function OnCureInfoHisCommand(e) {
        switch (e.name) {
            case "Detail": CureInfoDetail(e.dataItem.ID, e.dataItem.LastModifyTime); break;
        }
    }
</script>